package com.exbank.saving;

public class Account {

	private String nameOfAccountHolder;
	private long balance;

	public long deposite(int amountDeposite) {
		balance = balance + amountDeposite;
		return balance;
	}

	public long withDraw(int amountWithDraw) {
		balance = balance - amountWithDraw;
		return balance;
	}

	/**
	 * @return the balance
	 */
	public long getBalance() {
		return balance;
	}

	/**
	 * @param balance
	 *            the balance to set
	 */
	public void setBalance(long balance,String userName) {
		
		if(userName.equals("validUser"))
		{
			this.balance = balance;
		}
		}

	/**
	 * @return the nameOfAccountHolder
	 */
	public String getNameOfAccountHolder() {
		return nameOfAccountHolder;
	}

	/**
	 * @param nameOfAccountHolder
	 *            the nameOfAccountHolder to set
	 */
	public void setNameOfAccountHolder(String nameOfAccountHolder) {
		
		this.nameOfAccountHolder = nameOfAccountHolder;
	}

}
